from celery import Celery
from celery.schedules import crontab
from datetime import timedelta
from .config import config,task_module

# 生成celery对象，'task'相当于key，用于区分celery对象
# broker是指定消息处理，backend是指定结果后端的存储位置 include参数需要指定任务模块
app = Celery('task', broker=config.get('broker_url'), backend=config.get('result_backend'), include=task_module)
app.conf.update(**config)